<template>
  <uvInput
      :adjustPosition="adjustPosition"
      :autoBlur="autoBlur"
      :border="border"
      :clearable="clearable"
      :color="color"
      :confirmHold="confirmHold"
      :confirmType="confirmType"
      :cursor="cursor"
      :cursorSpacing="cursorSpacing"
      :customStyle="customStyle"
      :disableDefaultPadding="disableDefaultPadding"
      :disabled="disabled"
      :disabledColor="disabledColor"
      :fixed="fixed"
      :focus="focus"
      :fontSize="fontSize"
      :formatter="formatter"
      :holdKeyboard="holdKeyboard"
      :inputAlign="inputAlign"
      :maxlength="maxlength"
      :password="password"
      :placeholder="placeholder"
      :placeholderClass="placeholderClass"
      :placeholderStyle="placeholderStyle"
      :prefixIcon="prefixIcon"
      :prefixIconStyle="prefixIconStyle"
      :readonly="readonly"
      :selectionEnd="selectionEnd"
      :selectionStart="selectionStart"
      :shape="shape"
      :showWordLimit="showWordLimit"
      :suffixIcon="suffixIcon"
      :suffixIconStyle="suffixIconStyle"
      :type="type"
      :value="value"
      @blur="$emit('blur')"
      @change="e => $emit('change', e)"
      @clear="$emit('clear')"
      @click="$emit('click')"
      @confirm="e => $emit('confirm', e)"
      @focus="$emit('focus')"
      @input="e => $emit('input', e)"
      @keyboardheightchange="$emit('keyboardheightchange')"
  >
    <!-- #ifdef MP -->
    <slot name="prefix"></slot>
    <slot name="suffix"></slot>
    <!-- #endif -->
    <!-- #ifndef MP -->
    <slot slot="prefix" name="prefix"></slot>
    <slot slot="suffix" name="suffix"></slot>
    <!-- #endif -->
  </uvInput>
</template>

<script>
/**
 * 此组件存在的理由是，在nvue下，u-input被uni-app官方占用了，u-input在nvue中相当于input组件
 * 所以在nvue下，取名为u--input，内部其实还是u-input.vue，只不过做一层中转
 */
import uvInput from '../u-input/u-input.vue';
import props from '../u-input/props.js'

export default {
  name: 'u--input',
  mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
  components: {
    uvInput
  },
}
</script>